1. Provide a specification to describe the behaviour of this algorithm, and prove that it
correctly implements its specification